package cn.iune.erp.accounting;

import java.math.BigDecimal;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.Version;

import com.justep.baas.data.RowState;

/*
 * 行的主记录fID与列fParent无关联，行中的captionID与fParent对应，维持会计科目的树形关系
 */
@Entity
@Table(name = "PeriodCaption")
@NamedQuery(name="PeriodCaption.findAll", query="SELECT s FROM PeriodCaption s")
public class PeriodCaption {

	@Id
	@Column(length=36)
	private String fID;
	
	@Column(length=4)
	private String yearNo;
	@Column(length=2)
	private String periodNo;
	
	@Column(length=32)
	private String captionID;//科目编码
	@Column(length=10)
	private String captionNo;
	@Column(length=50)
	private String captionName;
	@Column(length=256)
	private String captionFullName;//科目名称
	@Column(length=4)
	private String billType;
	@Column(length=20)
	private String billTypeName;
	
	private int nodeLevel = 0;
	@Column(length=32)
	private String nodeKind;
	@Column(length=50)
	private String sortNo;
	@Column(length=32)
	private String fParent;
	
	private int dob =  1;//余额方向
	
	@Column(length=3)
	private String currency;//币种
	@Column(length=20)
	private String currencyLabel;//币种

	@Column(precision=38,scale=2)
	private BigDecimal debitBegin;//期初借方金额
	@Column(precision=38,scale=2)
	private BigDecimal creditBegin;//期初贷方金额
	
	@Column(precision=38,scale=2)
	private BigDecimal debitPeriod;//本期借方金额
	@Column(precision=38,scale=2)
	private BigDecimal creditPeriod;//本期贷方金额
	private int debitCount;//本期借方笔数
	private int creditCount;//本期贷方笔数 
	@Column(precision=38,scale=2)
	private BigDecimal debitYear;//本年累计借方金额 
	@Column(precision=38,scale=2)
	private BigDecimal creditYear;//年贷累计贷方金额
	
	@Column(precision=38,scale=2)
	private BigDecimal debitEnd;//期末借方金额 
	@Column(precision=38,scale=2)
	private BigDecimal creditEnd;//期末贷方金额 

	
	
	

	@Column(precision=38,scale=2)
	private BigDecimal debitYearBegin;//年初借方金额
	@Column(precision=38,scale=2)
	private BigDecimal creditYearBegin;//年初贷方金额
	@Column(precision=38,scale=2)
	private BigDecimal balanceYearBegin;//年初余额
	
	@Column(precision=38,scale=2)
	private BigDecimal balanceBegin;//期初余额
	@Column(precision=38,scale=2)
	private BigDecimal balanceEnd;//期末余额

	@Column(precision=38,scale=2)
	private BigDecimal debitYearEnd;//年末借方金额
	@Column(precision=38,scale=2)
	private BigDecimal creditYearEnd;//年末贷方金额
	@Column(precision=38,scale=2)
	private BigDecimal balanceYearEnd;//年末余额
	private int debitCountYear;//本年累计借方笔数
	private int creditCountYear;//本年累计贷方笔数 

	@Column(length=65)
	private String userId;

	@Column(length=128)
	private String enterpriseNo;
	@Column(length=128)
	private String enterpriseName;

	@Version
	private int version = 0;
	
	@Transient//非持久字段
	private RowState rowState;
	public RowState getRowState() {
		return rowState;
	}
	public void setRowState(RowState rowState) {
		this.rowState = rowState;
	}
	
	
	public int getVersion() {
		return version;
	}

	public void setVersion(int version) {
		this.version = version;
	}
	
	public String getUserId() {
		return userId;
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}
	
	public String getfID() {
		return fID;
	}
	public void setfID(String fID) {
		this.fID = fID;
	}
	public String getPeriodNo() {
		return periodNo;
	}
	public void setPeriodNo(String periodNo) {
		this.periodNo = periodNo;
	}
	public String getYearNo() {
		return yearNo;
	}
	public void setYearNo(String yearNo) {
		this.yearNo = yearNo;
	}
	public String getCaptionID() {
		return captionID;
	}
	public void setCaptionID(String captionID) {
		this.captionID = captionID;
	}
	public String getCaptionNo() {
		return captionNo;
	}
	public void setCaptionNo(String captionNo) {
		this.captionNo = captionNo;
	}
	public String getCaptionName() {
		return captionName;
	}
	public void setCaptionName(String captionName) {
		this.captionName = captionName;
	}
	public String getCaptionFullName() {
		return captionFullName;
	}
	public void setCaptionFullName(String captionFullName) {
		this.captionFullName = captionFullName;
	}
	public int getDob() {
		return dob;
	}
	public void setDob(int dob) {
		this.dob = dob;
	}
	public int getNodeLevel() {
		return nodeLevel;
	}
	public void setNodeLevel(int nodeLevel) {
		this.nodeLevel = nodeLevel;
	}
	public String getEnterpriseNo() {
		return enterpriseNo;
	}
	public void setEnterpriseNo(String enterpriseNo) {
		this.enterpriseNo = enterpriseNo;
	}
	public String getEnterpriseName() {
		return enterpriseName;
	}
	public void setEnterpriseName(String enterpriseName) {
		this.enterpriseName = enterpriseName;
	}
	public String getNodeKind() {
		return nodeKind;
	}
	public void setNodeKind(String nodeKind) {
		this.nodeKind = nodeKind;
	}
	public String getSortNo() {
		return sortNo;
	}
	public void setSortNo(String sortNo) {
		this.sortNo = sortNo;
	}
	public String getfParent() {
		return fParent;
	}
	public void setfParent(String fParent) {
		this.fParent = fParent;
	}
	public String getBillType() {
		return billType;
	}
	public void setBillType(String billType) {
		this.billType = billType;
	}
	public String getBillTypeName() {
		return billTypeName;
	}
	public void setBillTypeName(String billTypeName) {
		this.billTypeName = billTypeName;
	}
	public BigDecimal getDebitBegin() {
		return debitBegin;
	}
	public void setDebitBegin(BigDecimal debitBegin) {
		this.debitBegin = debitBegin;
	}
	public BigDecimal getCreditBegin() {
		return creditBegin;
	}
	public void setCreditBegin(BigDecimal creditBegin) {
		this.creditBegin = creditBegin;
	}
	public BigDecimal getDebitPeriod() {
		return debitPeriod;
	}
	public void setDebitPeriod(BigDecimal debitPeriod) {
		this.debitPeriod = debitPeriod;
	}
	public BigDecimal getCreditPeriod() {
		return creditPeriod;
	}
	public void setCreditPeriod(BigDecimal creditPeriod) {
		this.creditPeriod = creditPeriod;
	}

	public int getDebitCount() {
		return debitCount;
	}
	public void setDebitCount(int debitCount) {
		this.debitCount = debitCount;
	}
	public int getCreditCount() {
		return creditCount;
	}
	public void setCreditCount(int creditCount) {
		this.creditCount = creditCount;
	}
	public BigDecimal getDebitYear() {
		return debitYear;
	}
	public void setDebitYear(BigDecimal debitYear) {
		this.debitYear = debitYear;
	}
	public BigDecimal getCreditYear() {
		return creditYear;
	}
	public void setCreditYear(BigDecimal creditYear) {
		this.creditYear = creditYear;
	}
	public BigDecimal getDebitEnd() {
		return debitEnd;
	}
	public void setDebitEnd(BigDecimal debitEnd) {
		this.debitEnd = debitEnd;
	}
	public BigDecimal getCreditEnd() {
		return creditEnd;
	}
	public void setCreditEnd(BigDecimal creditEnd) {
		this.creditEnd = creditEnd;
	}
	public BigDecimal getDebitYearBegin() {
		return debitYearBegin;
	}
	public void setDebitYearBegin(BigDecimal debitYearBegin) {
		this.debitYearBegin = debitYearBegin;
	}
	public BigDecimal getCreditYearBegin() {
		return creditYearBegin;
	}
	public void setCreditYearBegin(BigDecimal creditYearBegin) {
		this.creditYearBegin = creditYearBegin;
	}
	public BigDecimal getBalanceYearBegin() {
		return balanceYearBegin;
	}
	public void setBalanceYearBegin(BigDecimal balanceYearBegin) {
		this.balanceYearBegin = balanceYearBegin;
	}
	public BigDecimal getBalanceBegin() {
		return balanceBegin;
	}
	public void setBalanceBegin(BigDecimal balanceBegin) {
		this.balanceBegin = balanceBegin;
	}
	public BigDecimal getBalanceEnd() {
		return balanceEnd;
	}
	public void setBalanceEnd(BigDecimal balanceEnd) {
		this.balanceEnd = balanceEnd;
	}
	public String getCurrency() {
		return currency;
	}
	public void setCurrency(String currency) {
		this.currency = currency;
	}
	public String getCurrencyLabel() {
		return currencyLabel;
	}
	public void setCurrencyLabel(String currencyLabel) {
		this.currencyLabel = currencyLabel;
	}
	public BigDecimal getDebitYearEnd() {
		return debitYearEnd;
	}
	public void setDebitYearEnd(BigDecimal debitYearEnd) {
		this.debitYearEnd = debitYearEnd;
	}
	public BigDecimal getCreditYearEnd() {
		return creditYearEnd;
	}
	public void setCreditYearEnd(BigDecimal creditYearEnd) {
		this.creditYearEnd = creditYearEnd;
	}
	public BigDecimal getBalanceYearEnd() {
		return balanceYearEnd;
	}
	public void setBalanceYearEnd(BigDecimal balanceYearEnd) {
		this.balanceYearEnd = balanceYearEnd;
	}
	public int getDebitCountYear() {
		return debitCountYear;
	}
	public void setDebitCountYear(int debitCountYear) {
		this.debitCountYear = debitCountYear;
	}
	public int getCreditCountYear() {
		return creditCountYear;
	}
	public void setCreditCountYear(int creditCountYear) {
		this.creditCountYear = creditCountYear;
	}
	
}